Array.prototype.myMap = function(fn){
    // 数组是myMap的调用者，this指向它
    const arr = this
    const res = []
    // 遍历调用者数组
    for (const iterator of arr) {
        res.push(fn(iterator))
    }
    return res
}
const arr = [1,2,3]
const newArr = arr.myMap(item=>item*2)
console.log(newArr)